<%@page import="models.GeoModel"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.TreeMap"%>
<%@page import="models.CooperationModel"%>
<%@page import="models.PageModel"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
PageModel businessCooperation = (PageModel) request.getAttribute("businessCooperation");
PageModel recruitment = (PageModel) request.getAttribute("recruitment");
String s = (String) request.getAttribute("s");
TreeMap check = (TreeMap) request.getAttribute("check");
CooperationModel cooperation = (CooperationModel) request.getAttribute("cooperation");
ArrayList<GeoModel> cities = (ArrayList<GeoModel>) request.getAttribute("geos");
%>

<jsp:include page="/layouts/header.jsp">
	<jsp:param name="language" value="1" />	
</jsp:include>

<script type="text/javascript" src="/js/cooperation.js"></script>

<script type="text/javascript">
$(document).ready(function () {
	activeTab("#<%=s%>");
});
</script>			
			<div id="content_inner">
				<div id="productDetailInfo" class="clearafter">
                	<div class="left">
                		<% if (session.getAttribute("success") != null) { %>
			            	<div class="notification-s">
			            		<img src="/images/icon_close.gif" />
			            		<%=session.getAttribute("success") %>
			            	</div>
			            	<% session.removeAttribute("success"); %>
			            <% } %>
			            <% if (session.getAttribute("error") != null) { %>
			            	<div class="notification-e">
			            		<img src="/images/icon_close.gif" />
			            		<%=session.getAttribute("error") %>
			            		<% session.removeAttribute("error"); %>
			            	</div>
			            <% } %>
                    	<ul class="menuTab clearafter">
                        	<li class="menuTabItem-1"><a href="#business-cooperation"><%=businessCooperation.getTitle() %></a></li>
                            <li class="menuTabItem-3"><a href="#recruitment"><%=recruitment.getTitle() %></a></li>
                        </ul>
                    	<div class="menuTabContent">
                        	<div id="business-cooperation">
                        		<h2 class="page-title"><%=businessCooperation.getTitle() %></h2>
                            	<%=businessCooperation.getContent() %>
                            	<div style="clear: both;"></div>
                            	
                            	<form method="post" action="" class="cooperation">
                                	<h1>Liên hệ hợp tác</h1>
                                    <p class="mandatory">Thông tin có <span class="redColor">*</span> là bắt buộc nhập, cần phải nhập.</p>
                                    <br />
                                    <p>Chào mừng bạn liên hệ hợp tác với onsale365!</p>
									<p>Bạn hãy để lại thông tin và nội dung đề nghị hợp tác, chúng tôi sẽ liên hệ ngay với bạn.</p>
                                    <br />
                                    <label class="clearafter <%=check.get("name") != null ? "error" : ""%>">
                                        <span class="left required">Tên:</span>
                                        <div class="left">
                                            <input type="text" name="name" value="<%=cooperation.getName()%>"/>
                                            <div class="triangleUp"></div>
                                            <div class="errorMessage">
                                                <% if (check.get("name") != null) { %>
                                            		<%=check.get("name") %>
                                            	<% } %>
                                            </div>  
                                        </div>
                                    </label>
                                    <label class="clearafter <%=check.get("email") != null ? "error" : ""%>">
                                        <span class="left required">Email:</span>
                                        <div class="left">
                                            <input type="text" name="email" value="<%=cooperation.getEmail()%>"/>
                                            <div class="triangleUp"></div>
                                            <div class="errorMessage">
                                            	<% if (check.get("email") != null) { %>
                                            		<%=check.get("email") %>
                                            	<% } %>
                                            </div>
                                        </div>
                                    </label>
                                    <label class="clearafter <%=check.get("phone") != null ? "error" : ""%>">
                                        <span class="left required">Số điện thoại:</span>
                                        <div class="left">
                                            <input type="text" name="phone" value="<%=cooperation.getPhone()%>"/>
                                            <div class="triangleUp"></div>
                                            <div class="errorMessage">
                                            	<% if (check.get("phone") != null) { %>
                                            		<%=check.get("phone") %>
                                            	<% } %>
                                            </div>
                                        </div>
                                    </label>
                                    <label class="clearafter <%=check.get("company") != null ? "error" : ""%>">
                                        <span class="left required">Tên công ty:</span>
                                        <div class="left">
                                            <input type="text" name="company" value="<%=cooperation.getCompany()%>"/>
                                            <div class="triangleUp"></div>
                                            <div class="errorMessage">
                                            	<% if (check.get("company") != null) { %>
                                            		<%=check.get("company") %>
                                            	<% } %>
                                            </div>
                                        </div>
                                    </label>
                                    <label class="clearafter <%=check.get("city") != null ? "error" : ""%>">
                                        <span class="left required">Khu vực :</span>
                                        <div class="left">
                                            <select name="city">
                                                <option value="" label="" <%=cooperation.getCity().equalsIgnoreCase("") ? "selected=\"selected\"" : "" %>>- Select -</option>
                                                <% for (int i = 0; i < cities.size(); i++) { %>
                                                <option value="<%=cities.get(i).getGeoId()%>" <%=cooperation.getCity().equalsIgnoreCase(cities.get(i).getGeoId()) ? "selected=\"selected\"" : "" %>><%=cities.get(i).getName()%></option>
                                                <% } %>
                                            </select>
                                            <div class="triangleUp"></div>
                                            <div class="errorMessage">
                                            	<% if (check.get("city") != null) { %>
                                            		<%=check.get("city") %>
                                            	<% } %>
											</div>
                                        </div>
                                    </label>
                                    <label class="clearafter <%=check.get("address") != null ? "error" : ""%>">
                                        <span class="left required">Địa chỉ:</span>
                                        <div class="left">
                                            <input type="text" name="address" value="<%=cooperation.getAddress()%>"/>
                                            <div class="triangleUp"></div>
                                            <div class="errorMessage">
                                            	<% if (check.get("address") != null) { %>
                                            		<%=check.get("address") %>
                                            	<% } %>
                                            </div>
                                        </div>
                                    </label>
                                    <label class="clearafter <%=check.get("content") != null ? "error" : ""%>">
                                        <span class="left required">Nội dung liên hệ:</span>
                                        <div class="left">
                                            <textarea name="content"><%=cooperation.getContent() %></textarea>
                                            <div class="triangleUp"></div>
                                            <div class="errorMessage">
                                            	<% if (check.get("content") != null) { %>
                                            		<%=check.get("content") %>
                                            	<% } %>
                                            </div>  
                                        </div>
                                    </label>                                                                                                            
                                    <div class="content-center">
                                    	<button type="submit" class="button blue">Xác nhận</button>
                                    </div>
                                </form>
                            </div>
                            <div id="recruitment">
                            	<h2 class="page-title"><%=recruitment.getTitle() %></h2>
                            	<%=recruitment.getContent() %>
                            	<div style="clear: both;"></div>
                            </div>
                        </div>
                    </div>
                    <div class="right rightSideBar">
                    	<jsp:include page="/elements/right_menu.jsp"/>
                    </div>
                </div>
			</div>

<jsp:include page="/layouts/footer.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>